home *** CD-ROM | disk | FTP | other *** search
/ Aminet 41 / Aminet 41 (2001)(Schatztruhe)[!][Feb 2001].iso / Aminet / gfx / edit / AmiCAD_2.07.lha / AmiCAD / ARexx / BoîteArrondie.AmiCAD < prev    next >
Text File  |  2000-11-03  |  1KB  |  43 lines

  1. /* Tracé d'une boîte aux coins arrondis */
  2. /* Version 1.00: 13 avril 1999
  3.    Version 1.01: 13 avril 2000 (modif GETZONE et SAVEALL)
  4.    Version 1.02: 3 novembre 2000 (localisation anglais/français)
  5. $VER: 1.02 (© R.Florac, 3 novembre 2000) */
  6.  
  7. options results     /* indispensable pour récupérer le résultat des macros */
  8.  
  9. signal on error     /* pour l'interception des erreurs */
  10. signal on syntax
  11.  
  12. 'LANGUAGE'
  13. if result='français.language' then fr=1
  14. else fr=0
  15.  
  16. if fr=1 then 'GETZONE("Dessinez la boîte avec la souris")'
  17. else 'GETZONE("Draw the box with the mouse")'
  18. c=result
  19. if c="" then exit
  20.  
  21. if fr=1 then 'ASKNUM("Rayon des angles?",10)'
  22. else 'ASKNUM("Angles radius ?",10)'
  23. angle=result
  24. if angle="" then exit
  25.  
  26. parse var c x0 ',' y0 ',' x1 ',' y1
  27. 'DEF BOXR(X,Y,Z,W,R)=M__=DRAWMODE(-1):GROUP(ARC(X+R,Y+R,R,R,-90,0),DRAW(X+R,Y,Z-R,Y),ARC(Z-R,Y+R,R,R,0,90),DRAW(Z,Y+R,Z,W-R),ARC(Z-R,W-R,R,R,90,180),DRAW(Z-R,W,X+R,W),ARC(X+R,W-R,R,R,180,270),DRAW(X,Y+R,X,W-R)):DRAWMODE(M__)'
  28. 'SAVEALL:BOXR('c','angle')'
  29.  
  30. exit
  31.  
  32. /* Traitement des erreurs, interruption du programme */
  33. syntax:
  34. erreur=RC
  35. if fr=1 then 'MESSAGE("Erreur de syntaxe"+CHR(10)+"en ligne 'SIGL'"+CHR(10)+"'errortext(erreur)'")'
  36. else 'MESSAGE("Syntax error"+CHR(10)+"in line 'SIGL'"+CHR(10)+"'errortext(erreur)'")'
  37. exit
  38.  
  39. error:
  40. if fr=1 then 'MESSAGE("Erreur en ligne 'SIGL'")'
  41. else 'MESSAGE("Error in line 'SIGL'")'
  42. exit
  43.